Identification and placement of new virtual machines to reduce memory consumption based on shared images with hosted virtual machines

ABSTRACT

A mechanism for optimal placement of VMs based on shared images is disclosed. A method of embodiments of the invention includes identifying a virtual machine (VM) image of a new VM to be placed by a host controller on one of a plurality of candidate host machines, for each candidate host machine of the plurality of candidate host machines, identifying a VM image for each VM hosted by the candidate host machine, and determining the candidate host with the most VMs having identical VM images to the new VM.

RELATED APPLICATION

The present application is related to co-filed U.S. patent applicationSer. No. 12/714,033 entitled “Mechanism for Optimizing Initial Placementof Virtual Machines to Reduce Memory Consumption Based on SimilarCharacteristics”, and co-filed U.S. patent application Ser. No.12/714,043 entitled “Mechanism for Dynamic Placement of Virtual MachinesDuring Live Migration Based on Memory”, which are both assigned to theassignee of the present application.

TECHNICAL FIELD

The embodiments of the invention relate generally to virtual machine(VM) systems and, more specifically, relate to optimal placement of VMsbased on shared images.

BACKGROUND

In computer science, a virtual machine (VM) is a portion of softwarethat, when executed on appropriate hardware, creates an environmentallowing the virtualization of an actual physical computer system. EachVM may function as a self-contained platform, running its own operatingsystem (OS) and software applications (processes). Typically, a virtualmachine monitor (VMM) manages allocation and virtualization of computerresources and performs context switching, as may be necessary, to cyclebetween various VMs.

A host machine (e.g., computer or server) is typically enabled tosimultaneously run multiple VMs, where each VM may be used by a remoteclient. The host machine allocates a certain amount of the host'sresources to each of the VMs. Each VM is then able to use the allocatedresources to execute applications, including operating systems known asguest operating systems. The VMM virtualizes the underlying hardware ofthe host machine or emulates hardware devices, making the use of the VMtransparent to the guest operating system or the remote client that usesthe VM.

In some virtualization systems, the host is a centralized server that ispartitioned into multiple VMs to provide virtual desktops to userswithin an enterprise. A problem with centralized hosting of VMs is theuse of shared storage amongst the VMs. Typically, each VM is allocatedsome minimum storage space out of the shared pool of storage. Becausethe total amount of storage in a shared pool of storage is a fixedamount, conserving disk space becomes an important consideration invirtualization systems. The storage allocation per VM is usually asparse amount that is allocated on-demand; rather than allocating toeach VM the maximum amount of storage that the VM may use.Virtualization systems require storage allocation in this sparse mannerin order to conserve disk space for use only by VM systems that requirethe storage.

One exemplary use of the shared storage for VMs is to store an imagetemplate of a VM, so as to reduce or eliminate the need to install an OSand applications in every copy of a VM on a host machine and to reducedisk image size. This image template may include a codebase of anoperating system (a guest operating system) and applications running onthe guest operating system, as well as libraries and data used by theguest operating system and the applications. The size of a typical VMimage is substantial. For example, an enterprise's virtual machine imageis usually more than 10 GB. Hence, in an enterprise with 1,000 users,the storage requirement for virtual machine images is likely to exceed10 TB. Maintaining such a large amount of storage is expensive andinefficient.

Most virtualization systems include one or more clusters of hostmachines that each run multiple VMs. Upon initialization of a new VM, ahost machine must be selected to host this VM. Many factors may beconsidered in the initial placement of this VM, including, but notlimited to, CPU usage, power consumption considerations, and so on. Amechanism for optimizing the initial placement of a VM to considerreduction of memory consumption as part of the multiple factors ofinitial placement would be beneficial.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention will be understood more fully from the detaileddescription given below and from the accompanying drawings of variousembodiments of the invention. The drawings, however, should not be takento limit the invention to the specific embodiments, but are forexplanation and understanding only.

FIG. 1 is a block diagram of an exemplary network architecture in whichembodiments of the invention may operate;

FIG. 2 is a flow diagram illustrating a method for optimizing initialplacement of virtual machines (VMs) to reduce memory consumption basedon similar characteristics of VMs according to an embodiment of theinvention;

FIG. 3 is a flow diagram illustrating a method for optimizing initialplacement of VMs to reduce memory consumption based on identical imagesof VMs according to an embodiment of the invention; and

FIG. 4 illustrates a block diagram of one embodiment of a computersystem.

DETAILED DESCRIPTION

Embodiments of the invention provide a mechanism for optimal placementof VMs based on shared images. A method of embodiments of the inventionincludes identifying a virtual machine (VM) image of a new VM to beplaced by a host controller on one of a plurality of candidate hostmachines, for each candidate host machine of the plurality of candidatehost machines, identifying a VM image for each VM hosted by thecandidate host machine, and determining the candidate host with the mostVMs having identical VM images to the new VM.

In the following description, numerous details are set forth. It will beapparent, however, to one skilled in the art, that the present inventionmay be practiced without these specific details. In some instances,well-known structures and devices are shown in block diagram form,rather than in detail, in order to avoid obscuring the presentinvention.

Some portions of the detailed descriptions which follow are presented interms of algorithms and symbolic representations of operations on databits within a computer memory. These algorithmic descriptions andrepresentations are the means used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. An algorithm is here, and generally,conceived to be a self-consistent sequence of steps leading to a desiredresult. The steps are those requiring physical manipulations of physicalquantities. Usually, though not necessarily, these quantities take theform of electrical or magnetic signals capable of being stored,transferred, combined, compared, and otherwise manipulated. It hasproven convenient at times, principally for reasons of common usage, torefer to these signals as bits, values, elements, symbols, characters,terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise, as apparent from the followingdiscussion, it is appreciated that throughout the description,discussions utilizing terms such as “sending”, “receiving”, “attaching”,“forwarding”, “caching”, or the like, refer to the action and processesof a computer system, or similar electronic computing device, thatmanipulates and transforms data represented as physical (electronic)quantities within the computer system's registers and memories intoother data similarly represented as physical quantities within thecomputer system memories or registers or other such information storage,transmission or display devices.

The present invention also relates to an apparatus for performing theoperations herein. This apparatus may be specially constructed for therequired purposes, or it may comprise a general purpose computerselectively activated or reconfigured by a computer program stored inthe computer. Such a computer program may be stored in a computerreadable storage medium, such as, but not limited to, any type of diskincluding floppy disks, optical disks, CD-ROMs, and magnetic-opticaldisks, read-only memories (ROMs), random access memories (RAMs), EPROMs,EEPROMs, magnetic or optical cards, or any type of media suitable forstoring electronic instructions, each coupled to a computer system bus.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general purposesystems may be used with programs in accordance with the teachingsherein, or it may prove convenient to construct more specializedapparatus to perform the required method steps. The required structurefor a variety of these systems will appear as set forth in thedescription below. In addition, the present invention is not describedwith reference to any particular programming language. It will beappreciated that a variety of programming languages may be used toimplement the teachings of the invention as described herein.

The present invention may be provided as a computer program product, orsoftware, that may include a machine-readable medium having storedthereon instructions, which may be used to program a computer system (orother electronic devices) to perform a process according to the presentinvention. A machine-readable medium includes any mechanism for storingor transmitting information in a form readable by a machine (e.g., acomputer). For example, a machine-readable (e.g., computer-readable)medium includes a machine (e.g., a computer) readable storage medium(e.g., read only memory (“ROM”), random access memory (“RAM”), magneticdisk storage media, optical storage media, flash memory devices, etc.),a machine (e.g., computer) readable transmission medium (non-propagatingelectrical, optical, or acoustical signals), etc.

Embodiments of the invention provide a mechanism for optimizing initialplacement of VMs to reduce memory consumption. To reduce memoryconsumption in embodiments of the invention, a VM placement agent of ahost controller selects an optimum host machine to place anewly-initialized VM by determining which host machine of multiplecandidate host machines includes the most VMs that will share RAM memorywith the newly-initialized VM to be placed. In one embodiment,identifying VMs that will share RAM memory with the newly-initialized VMincludes determining a host having the most VMs with similarcharacteristics to the new VM. In another embodiment, identifying VMsthat will share RAM memory with the newly-initialized VM includesdetermining a host having the most VMs with identical VM images to thenew VM. Although embodiments of the invention refer to initial placementof a VM, one skilled in the art will appreciate that solutions providedin embodiments of the invention may apply equally to migration of a VMas well.

FIG. 1 illustrates an exemplary network architecture 100 in whichembodiments of the present invention may operate. The networkarchitecture 100 may include a host machine 103 coupled to one or moreclients 101 over a network 102. The network 102 may be a private network(e.g., a local area network (LAN), wide area network (WAN), intranet,etc.) or a public network (e.g., the Internet). In some embodiments,clients 101 may be hosted directly by a host machine 103 as a localclient on host machine 103. Host machine 103 may be part of a cluster ofhost machines 103. The host machine 103 may be coupled to a hostcontroller 105 (via a network or directly). Alternatively, the hostcontroller 105 may be part of the host machine 103.

In one embodiment, the clients 101 may include computing devices thathave a wide range of processing capabilities. Some or all of the clients101 may be thin clients, which serve as access terminals for users anddepend primarily on the host machine 103 for processing activities. Forexample, the client 101 may be a desktop computer, laptop computer,cellular phone, personal digital assistant (PDA), etc. The client 101may run client applications such as a Web browser and a graphic userinterface (GUI). The client 101 may also run other client applicationsto receive multimedia data streams or other data sent from the hostmachine 103 and re-direct the received data to a display or other userinterface.

In one embodiment, host machine 103 runs one or more virtual machines(VMs) 131. Each VM 131 runs a guest operating system (OS) that may bedifferent from one another. The guest OS may include Microsoft Windows,Linux, Solaris, Mac OS, etc. The host machine 103 may include ahypervisor 135 that emulates the underlying hardware platform for theVMs 131. The hypervisor 135 may also be known as a virtual machinemonitor (VMM), a kernel-based hypervisor or a host operating system.

Each VM 131 can be accessed by one or more of the clients 101 over thenetwork 102. In one scenario, the VM 131 can provide a virtual desktopfor the client 101. In other embodiments, the VM 131 may provide avirtual server for the client 101. The VMs 131 can be managed by thehost controller 105, which may reside on a designated computer system(e.g., a server computer, a desktop computer, etc.) or be part of thehost machine 103 or another machine. The host controller 105 may alsoadd a VM, delete a VM, balance the load on the server cluster, providedirectory service to the VMs 131, and perform other managementfunctions.

The host machine 103 may also be coupled to data storage 120. Datastorage 120 may represent multiple storage devices (e.g., disks in adisk array) associated with individual VMs 131, or a single storagedevice (e.g., hard drive of the host machine 103) including areasdesignated for individual VMs 131. When a VM 131 is created, it isassociated with individual data storage 120, which may be an independentstorage device or a designated area of the storage device.

The host machine 103 may further be coupled to common data storage 125directly or remotely. Common data storage 125 may represent a designatedarea of the same storage device as data storage 120 (e.g., a diskdrive), an independent storage device coupled with the host machine 103directly (e.g., a disk drive) or a remote storage device (e.g., networkattached storage (NAS), etc.).

In one embodiment, host controller 105 may include a VM placement agent107. VM placement agent 107 is responsible for making a determination ofwhich host machine 103 a VM 131 should be placed upon its creation.Although only one host machine 103 is shown in FIG. 1, for purposes ofexplanation assume that a plurality of host machines 103 exist innetwork 100. In one embodiment, VM placement agent 107 utilizes ageneral scheduling algorithm that considers a variety of factors forinitial placement of a VM 131. Such factors may include, but are notlimited to, CPU utilization, CPU speed, memory space, and memoryutilization. Embodiments of the invention introduce the concept ofreducing memory consumption as one of the factors for VM placement agent107 to consider in initial placement of a VM 131 on a host machine 103.

In one embodiment, each host machine 103 includes a memory sharing agent137 that operates to unify shared pages of VMs 131 running on that hostmachine 103. In one embodiment, the memory sharing agent 137 is a KernelSamePage Merging (KSM) feature of a Linux kernel running in host machine103. The KSM feature is generally found inside the host kernel of hostmachine 103. Instead of each VM 131 storing identical memory pagesseparately, the memory sharing agent 137 can identify these shared pagesand store one copy of these memory pages in the host machine memory 109that may be accessed by each VM 131.

To reduce memory consumption in embodiments of the invention, the VMplacement agent 107 of host controller 105 selects an optimum hostmachine 103 to place a newly-initialized VM 131 by determining whichhost machine 103 includes the most VMs 131 that will share RAM memorywith the newly-initialized VM 131 to be placed. Once the VM is placed onthe host machine 103, the memory sharing agent 137 of that host machine103 can unify memory pages of the newly-placed VM 131 withcommonly-shared memory pages of the VMs 131 already running on the hostmachine 103. This unification of memory pages operates to reduce overallmemory consumption on the host machine 103.

In one embodiment, selecting an optimal host machine 103 to place anewly-initialized VM includes identifying VMs 131 running on the hostthat have similar characteristics to the VM to be placed. Similarcharacteristics may include, for example, similar operating systems,similar applications, and similar libraries. In one embodiment, VMplacement manager 107 communicates with VM agents 132 of each VM 131 inorder to determine the current OS and the current applications runningon each VM 131. In one embodiment, this communication occurs on anon-going basis whenever any changes are made at the VM. In otherembodiments, the communication may occur when the VM placement agent 107is performing the general scheduling algorithm to place a new VM andrequires this information as part of embodiments of the invention.

Once the characteristics of all currently-running VMs are known, the VMplacement agent 107 compares the determined characteristics with thecharacteristics of the VM to-be-placed in order to find similarities.The host machine 103 with the most VMs 131 having similarcharacteristics to the VM to-be-placed is then identified to ascheduling algorithm of the VM placement agent 107 for preferentialtreatment by the algorithm.

Utilizing similar characteristics in embodiments of the invention allowsflexibility in placing a VM, because identical features do not have toexist in order to meet the criteria for placement. For example, a VM 131running the same type, but not necessarily same version, of an OS and/orapplication as the VM to be placed may be considered to have similarcharacteristics for purposes of the scheduling algorithm used by the VMplacement agent 107 in embodiments of the invention. The required extentof similarity for each VM characteristic and a collection of VMcharacteristics may be predetermined or configurable by a user (e.g., asystem administrator) and stored in a data store accessible by the VMplacement agent 107.

In another embodiment, selecting an optimal host machine 103 to place anewly-initialized VM includes identifying VMs 131 running on the hostmachine 103 that have an identical VM image template to the VM to beplaced. A VM image template may include, for example, a codebase of theguest OS and applications running in the VM 131, and the libraries anddata used by the guest OS and the applications. A VM image template mayalso include components required by all users of clients 101 (e.g.,installation files of a guest OS, a web browser application, ananti-virus application, an email application, etc.) and componentsspecific to individual users (e.g., profiles, user specificapplications, etc.).

In embodiments of the invention, identifying VMs 131 running on a hostmachine 103 that have an identical VM image template to the VM beingplaced involves the VM placement agent 107 having to examine the actualVM image templates 131 stored by a host machine 103. In one embodiment,VM placement agent 107 may utilize the memory sharing agent 137 of hostmachine 103 to assist in locating shared or common VM images. However,VM placement agent 107 also searches individual VM storage 120 for VMimage template information.

The optimal placement of VMs based on shared memory in embodiments ofthe invention has the effect of reducing RAM usage 109 on the hostmachine. For instance, in the case of placing a VM on a host running VMswith identical image templates, embodiments of the invention gainadditional RAM savings (as well as the standard savings of disk storage)and improved performance due to increased usage of cache hits on thehost machine. This is because when image files are accessed by the host,the host automatically caches that file in its own file system cache.These caches are per image (or a standard file because an image canactually be a file). When a VM is using a template image, it hasread-only access to the base image, called the template. Over thistemplate, a VM has an additional file to hold its image specific data.This is per-VM file with write access. When a host is running severalVMs and uses either local storage or network storage file system (NFS),all of its image files and base templates are cached.

In one example scenario, assume that there are 10 different base imagetemplates in a virtualization system. For example: 1) WINDOWS XP; 2)WINDOWS XP with Office; 3) RED HAT Enterprise Linux 5.4; 4) WINDOWSServer 2008; and so on. Many VMs can be created utilizing these baseimage templates. Also assume that there are 4 VMs to be allocated to 2host machines in the virtualization system. Two of the VMs have theWinXp base image template, and the other two VMs have the Linux 5.4 baseimage template. Embodiments of the invention perform VM allocation bytaking the shared image templates into account. The two WinXP VMs wouldrun on host #1, and the two Linux VMs would run on host #2, thus notwasting RAM for the host cache and being able to use more RAM forcaching the same images, as well as reduce the number of disk accesses,thereby gaining better performance.

FIG. 2 is a flow diagram illustrating a method 200 for optimizinginitial placement of VMs to reduce memory consumption based on similarcharacteristics of VMs according to an embodiment of the invention.Method 200 may be performed by processing logic that may comprisehardware (e.g., circuitry, dedicated logic, programmable logic,microcode, etc.), software (such as instructions run on a processingdevice), or a combination thereof. In one embodiment, method 200 isperformed by VM placement agent 107 of FIG. 1.

Method 200 begins at block 210 where characteristics of a new VM to beplaced are identified. Characteristics of the VM may include, forexample, the operating system and applications to be run by the VM.Then, at block 220, potential candidate host machines that may host thenew VM are identified (e.g., based on geographic location, anorganization's department of a VM user, etc.). At block 230, for eachidentified candidate host machine, characteristics of each VM on thecandidate host are determined via communications with a VM agent on thecandidate host. In one embodiment, the communications with the VM agentare on an on-going basis and the characteristic information is stored bythe host controller for future use. In other embodiments, thecommunication with the VM agent may occur at the time of the placementof the new VM. The VM agent is capable of identifying the current OS andthe current applications running on the VM it is associated with, aswell as other classified characteristics.

Subsequently, at block 240, the candidate host that includes the mostVMs having similar characteristics to the VM to be placed is thenidentified as the optimum host to reduce memory consumption. Thisidentification is provided to a scheduling algorithm that is used toultimately select the candidate host on which to place the new VM. Thescore for the identified candidate host in the scheduling algorithm maythen be adjusted accordingly to reflect the memory consumption savingthat the candidate host would provide if the new VM was placed there.

FIG. 3 is a flow diagram illustrating a method 300 for optimizinginitial placement of VMs to reduce memory consumption based on identicalimage templates of VMs according to an embodiment of the invention.Method 300 may be performed by processing logic that may comprisehardware (e.g., circuitry, dedicated logic, programmable logic,microcode, etc.), software (such as instructions run on a processingdevice), or a combination thereof. In one embodiment, method 300 isperformed by VM placement agent 107 of FIG. 1.

Method 300 begins at block 310 where the VM image template of a new VMto be placed is identified. The VM image template may include, forexample, a codebase of the guest OS and applications running in the VM,as well as the libraries and data used by the guest OS and theapplications. A VM image template may also include components requiredby all users of clients 101 (e.g., installation files of a guest OS, aweb browser application, an antivirus application, an email application,etc.) and components specific to individual users (e.g., profiles, userspecific applications, etc.).

At block 320, potential candidate host machines that may host the new VMare identified (e.g., based on geographic location, an organization'sdepartment of a VM user, etc.). Then, at block 330, for each identifiedcandidate host machine, the VM image template of each VM hosted by thecandidate host machine is examined. In one embodiment, the VM imagetemplate is stored in individual VM data storage and/or in commonstorage associated with the candidate host machine. In one embodiment, amemory sharing agent may be utilized to assist in locating andidentifying VM images templates of each candidate host machine.

Subsequently, at block 340, the candidate host that includes the mostVMs having an identical VM image template match to the VM to be placedis then identified as the optimum host to reduce memory consumption andthe number of I/O accesses outside of the host machine. Thisidentification of the optimum host is provided to a scheduling algorithmthat is used to ultimately select the candidate host on which to placethe new VM. The score for the identified candidate host in thescheduling algorithm may then be adjusted accordingly to reflect thememory consumption saving that the candidate host would provide if thenew VM was placed there.

FIG. 4 illustrates a diagrammatic representation of a machine in theexemplary form of a computer system 400 within which a set ofinstructions, for causing the machine to perform any one or more of themethodologies discussed herein, may be executed. In alternativeembodiments, the machine may be connected (e.g., networked) to othermachines in a LAN, an intranet, an extranet, or the Internet. Themachine may operate in the capacity of a server or a client machine in aclient-server network environment, or as a peer machine in apeer-to-peer (or distributed) network environment. The machine may be apersonal computer (PC), a tablet PC, a set-top box (STB), a PersonalDigital Assistant (PDA), a cellular telephone, a web appliance, aserver, a network router, switch or bridge, or any machine capable ofexecuting a set of instructions (sequential or otherwise) that specifyactions to be taken by that machine. Further, while only a singlemachine is illustrated, the term “machine” shall also be taken toinclude any collection of machines that individually or jointly executea set (or multiple sets) of instructions to perform any one or more ofthe methodologies discussed herein.

The exemplary computer system 400 includes a processing device 402, amain memory 404 (e.g., read-only memory (ROM), flash memory, dynamicrandom access memory (DRAM) (such as synchronous DRAM (SDRAM) or RambusDRAM (RDRAM), etc.), a static memory 406 (e.g., flash memory, staticrandom access memory (SRAM), etc.), and a data storage device 418, whichcommunicate with each other via a bus 430.

Processing device 402 represents one or more general-purpose processingdevices such as a microprocessor, central processing unit, or the like.More particularly, the processing device may be complex instruction setcomputing (CISC) microprocessor, reduced instruction set computer (RISC)microprocessor, very long instruction word (VLIW) microprocessor, orprocessor implementing other instruction sets, or processorsimplementing a combination of instruction sets. Processing device 402may also be one or more special-purpose processing devices such as anapplication specific integrated circuit (ASIC), a field programmablegate array (FPGA), a digital signal processor (DSP), network processor,or the like. The processing device 402 is configured to execute theprocessing logic 426 for performing the operations and steps discussedherein.

The computer system 400 may further include a network interface device408. The computer system 400 also may include a video display unit 410(e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)), analphanumeric input device 412 (e.g., a keyboard), a cursor controldevice 414 (e.g., a mouse), and a signal generation device 416 (e.g., aspeaker).

The data storage device 418 may include a machine-accessible storagemedium 428 on which is stored one or more set of instructions (e.g.,software 422) embodying any one or more of the methodologies offunctions described herein. For example, software 422 may storeinstructions to implement a method of optimizing initial placement ofVMs to reduce memory consumption based on similar characteristics of VMsperformed by VM placement agent 107 described with respect to FIG. 1.The software 422 may also reside, completely or at least partially,within the main memory 404 and/or within the processing device 402during execution thereof by the computer system 400; the main memory 404and the processing device 402 also constituting machine-accessiblestorage media. The software 422 may further be transmitted or receivedover a network 420 via the network interface device 408.

The machine-readable storage medium 428 may also be used to storedinstructions to perform methods 200 and 300 for optimizing initialplacement of VMs to reduce memory consumption described with respect toFIGS. 2 and 3, and/or a software library containing methods that callthe above applications. While the machine-accessible storage medium 428is shown in an exemplary embodiment to be a single medium, the term“machine-accessible storage medium” should be taken to include a singlemedium or multiple media (e.g., a centralized or distributed database,and/or associated caches and servers) that store the one or more sets ofinstructions. The term “machine-accessible storage medium” shall also betaken to include any medium that is capable of storing, encoding orcarrying a set of instruction for execution by the machine and thatcause the machine to perform any one or more of the methodologies of thepresent invention. The term “machine-accessible storage medium” shallaccordingly be taken to include, but not be limited to, solid-statememories, and optical and magnetic media.

Whereas many alterations and modifications of the present invention willno doubt become apparent to a person of ordinary skill in the art afterhaving read the foregoing description, it is to be understood that anyparticular embodiment shown and described by way of illustration is inno way intended to be considered limiting. Therefore, references todetails of various embodiments are not intended to limit the scope ofthe claims, which in themselves recite only those features regarded asthe invention.

What is claimed is:
 1. A method, comprising: identifying, by a hostcontroller device, a virtual machine (VM) image template of a new VM tobe placed by the host controller device on one of a plurality ofcandidate host machines; for each candidate host machine of theplurality of candidate host machines: locating, via communication with amemory sharing agent executing on the candidate host machine, a VM imagetemplate of each VM hosted by the candidate host machine, wherein the VMimage template of each VM is stored on the candidate host machine in anindividual storage associated with each VM or a common storage for oneor more VMs; and identifying a number of VMs hosted by the candidatehost machine associated with a VM image template that is identical tothe VM image template of the new VM to be placed; identifying, by thehost controller device, a candidate host machine from the plurality ofcandidate host machines comprising a most number of VMs with identicalVM image templates to the VM image template of the new VM; selecting, bythe host controller device, the identified candidate host machine tohost the new VM; and placing, by the host controller device, the new VMon the identified candidate host machine, wherein the memory sharingagent executing on the identified candidate host machine implements apage merging feature to further consolidate memory pages of the new VMwith memory pages of the VMs already hosted on the identified candidatehost machine to reduce overall memory consumption on the identifiedcandidate host machine.
 2. The method of claim 1, wherein the VM imagetemplate of the new VM to be placed and each VM hosted by the candidatehost machine comprises at least one of a codebase of a guest operatingsystem (OS) of the VM, a codebase of one or more applications of the VM,libraries used by the OS and the one or more applications of the VM, ordata used by the OS and the one or more applications of the VM.
 3. Themethod of claim 1, wherein the host controller device comprises a VMplacement agent to perform the locating and the identifying of the VMimage templates stored on the plurality of candidate host machines, theidentifying of the candidate host machine from the plurality ofcandidate host machines, and the selecting and the placement of the newVM on the identified candidate host machine.
 4. The method of claim 1,wherein the page merging feature is a Kernel SamePage Merging (KSM)feature of a Linux™ kernel.
 5. The method of claim 4, wherein the memorysharing agent is the KSM feature.
 6. The method of claim 4, wherein theLinux™ kernel is running in the candidate host machine hosting the newVM.
 7. A system, comprising: a memory; a processing device communicablycoupled to the memory; and a host controller device executable from thememory and the processing device, the host controller device to:identify a VM image template of a new VM to be placed on one of aplurality of candidate host machines; for each candidate host machine ofthe plurality of candidate host machines: locate, via communication witha memory sharing agent executing on the candidate host machine, a VMimage template of each VM hosted by the candidate host machine, whereinthe VM image template of each VM is stored on the candidate host machinein an individual storage associated with each VM or a common storage forone or more VMs; and identify a number of VMs hosted by the candidatehost machine associated with a VM image template that is identical tothe VM image template of the new VM to be placed; identify a candidatehost machine from the plurality of candidate host machines comprising amost number of VMs with identical VM image templates to the VM imagetemplate of the new VM; select the identified candidate host machine tohost the new VM; and place the new VM on the identified candidate hostmachine, wherein the memory sharing agent executing on the identifiedcandidate host machine additionally implements a page merging feature tofurther consolidate memory pages of the new VM with memory pages of theVMs already hosted on the identified candidate host machine to reduceoverall memory consumption on the identified candidate host machine. 8.The system of claim 7, wherein the VM image template of the new VM to beplaced and each VM hosted by the candidate host machine comprise atleast one of a codebase of a guest operating system (OS) of the VM, acodebase of one or more applications of the VM, libraries used by the OSand the one or more applications of the VM, or data used by the OS andthe one or more applications of the VM.
 9. The system of claim 7,wherein the host controller device comprises a VM placement agent toperform the locating and the identifying of the VM image templatesstored on the plurality of candidate host machines, the identifying ofthe candidate host machine from the plurality of candidate hostmachines, and the selecting and the placement of the new VM on theidentified candidate host machine.
 10. The system of claim 7, whereinthe page merging feature is a Kernel SamePage Merging (KSM) feature of aLinux™ kernel.
 11. The system of claim 10, wherein the memory sharingagent is the KSM feature.
 12. The system of claim 10, wherein the Linux™kernel is running in the candidate host machine hosting the new VM. 13.A non-transitory machine-readable storage medium including instructionsthat, when accessed by a processing device, cause the processing deviceto perform operations comprising: identifying, by the processing deviceof a host controller device, a virtual machine (VM) image template of anew VM to be placed by the host controller device on one of a pluralityof candidate host machines; for each candidate host machine of theplurality of candidate host machines: locating, via communication with amemory sharing agent executing on the candidate host machine, a VM imagetemplate of each VM hosted by the candidate host machine, wherein the VMimage template of each VM is stored on the candidate host machine in anindividual storage associated with each VM or a common storage for oneor more VMs; and identifying a number of VMs hosted by the candidatehost machine associated with a VM image template that is identical tothe VM image template of the new VM to be placed; identifying, by thehost controller device, a candidate host machine from the plurality ofcandidate host machines comprising a most number of VMs with identicalVM image templates to the VM image template of the new VM; selecting, bythe host controller device, the identified candidate host machine tohost the new VM; and placing, by the host controller device, the new VMon the identified candidate host machine, wherein the memory sharingagent executing on the identified candidate host machine additionallyimplements a page merging feature to further consolidate memory pages ofthe new VM with memory pages of the VMs already hosted on the identifiedcandidate host machine to reduce overall memory consumption on theidentified candidate host machine.
 14. The non-transitorymachine-readable storage medium of claim 13, wherein the VM imagetemplate of the new VM to be placed and each VM hosted by the candidatehost machine comprise at least one of a codebase of a guest operatingsystem (OS) of the VM, a codebase of one or more applications of the VM,libraries used by the OS and the one or more applications of the VM, ordata used by the OS and the one or more applications of the VM.
 15. Thenon-transitory machine-readable storage medium of claim 13, wherein thehost controller device comprises a VM placement agent to perform thelocating and the identifying of the VM image templates stored on theplurality of candidate host machines, the identifying of the candidatehost machine from the plurality of candidate host machines, and theselecting and the placement of the new VM on the identified candidatehost machine.
 16. The non-transitory machine-readable storage medium ofclaim 13, wherein the page merging feature is a Kernel SamePage Merging(KSM) feature of a Linux™ kernel.
 17. The non-transitorymachine-readable storage medium of claim 16, wherein the memory sharingagent is the KSM feature.
 18. The non-transitory machine-readablestorage medium of claim 16, wherein the Linux™ kernel is running in thecandidate host machine hosting the new VM.